//
//  GCDTest.swift
//  SwiftTest
//
//  Created by bym on 2019/8/6.
//  Copyright © 2019 ZZ. All rights reserved.
//

import UIKit

class GCDExample: NSObject {
	override init() {
		gcdMethod()
	}
}

func gcdMethod() {
	//主队列异步执行
	DispatchQueue.main.async {
		
	}
	//异步执行回主线程写法
	DispatchQueue.global().async {
		
		DispatchQueue.main.async {
			
		}
	}
	
	//延迟执行
	DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) {
		
	}
}
